﻿<local:DocumentBase x:Class="WPFExcelReport.JLTVKAV95"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    Loaded="Window_Loaded" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:tra="clr-namespace:WPFExcelReport.TranslationByMarkupExtension;assembly=ReflectionStudio.Core"
                    FontSize="14" 
                    Background="White" 
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=ICC_VKAV95,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"></RowDefinition>
            <RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel >

                <TextBlock Width="Auto">订单号:</TextBlock>
                <TextBox   Name="txtVKPAUFKRS" MaxLength="2" Width="40" Margin="10,0,0,0"  
                               Text="{Binding Path=VKPAUFKRS, Source={StaticResource ResourceKey=vwVKPOS}}"
                               HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                <TextBox   Name="txtVKPAUFLFD" KeyDown="txtVKPAUFLFD_KeyDown" 
                                      Text="{Binding Path=VKPAUFLD, Source={StaticResource ResourceKey=vwVKPOS}}"
                               MaxLength="6" Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" TabIndex="12" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>


                <Button Content="EXCEL" Margin="20,0,0,0" Name="btnReport" Width="47" Click="btnReport_Click" TabIndex="14" />
                <Button   Content="预览" Margin="20,0,0,0" Name="btnPrintPreview" Width="51" Click="btnPrintPreview_Click" TabIndex="15" />

            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="2"  Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="2"  >
            <DataGrid VerticalAlignment="Top"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="False"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}"  
                              HeadersVisibility="Column"
                                MaxHeight="500"
                              x:Name="dgVKPOS"    
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" 
                              >
                <DataGrid.Columns>
                   <DataGridTextColumn Binding="{Binding Path=VKPAUF}" Header="销售单"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=PRODFACT}" Header="生产单位"   Width="Auto"  MinWidth="40"/>                    
                    <DataGridTextColumn Binding="{Binding Path=VKPFART}" Header="品名"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE}" Header="颜色"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=STRUCTURE}" Header="规格"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FWIDTH}" Header="幅宽"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="单位"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPTOL, Converter={StaticResource ResourceKey=gb2312}}" Header="交货范围"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="生产交期"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FENTRYDAT}" Header="入库时间"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FQTY1}" Header="一等品"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FQTY1OVER}" Header="多余"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPOPENDEL}" Header="待发"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FQTY2}" Header="二等品"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FQTY2REASON}" Header="降等原因"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPFRDAT}" Header="发货日期"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPFREIGE}" Header="发货数量"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=FSTOCK}" Header="库存数量"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKKSACHBE}" Header="跟单"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPVERS}" Header="开票数"  Width="Auto" MinWidth="40"/>                    
                    <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="备注"  Width="Auto" MinWidth="40"/>                    
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel> 
   
            </Grid>
</local:DocumentBase>